﻿@model NK.Mvc3.Models.StoreInputDetail
@using (Ajax.BeginForm("AjaxUpdate", "StoreInputDetail", null, new AjaxOptions
{
    HttpMethod = "POST",
    InsertionMode = InsertionMode.Replace,
    UpdateTargetId = "gridrow-" + Model.ID
}, new { @id = "ajaxupdateform-" + Model.ID, }))
 {

         <div class="gridcell">
             @Html.TextBox("dtupdateBarCode", null, new
                                                                   {
                                                                       @class = "grid-textbox-text",
                                                                       Value = Model.ProductInfo.BarCode,
                                                                       onchange = "changeBarCode(this,'hdProductInfoID','dtupdatePOSDescription')"
                                                                   })
             @Html.ValidationMessage("dtupdateBarCode")
             @Html.HiddenFor(model => model.ID)
        
             @Html.HiddenFor(model => model.StoreInputID, new {Value = Model.StoreInput.ID, id = "hdStoreInputID"})
             @Html.ValidationMessageFor(model => model.StoreInputID)

             @Html.HiddenFor(model => model.ProductInfoID, new {id = "hdProductInfoID"})
             @Html.ValidationMessageFor(model => model.ProductInfoID)
         </div>
    
         <div class="gridcell">
             @Html.TextBox("dtupdatePOSDescription", null, new {@class = "grid-textbox-text", disabled = "disabled", Value = Model.ProductInfo.POSDescription})
         </div>
    
         <div class="gridcell">
             @Html.TextBoxFor(model => model.Quantity, new {@class = "grid-textbox-num"})
             @Html.ValidationMessageFor(model => model.Quantity)
         </div>
    
         <div class="gridcell">
             @Html.TextBoxFor(model => model.ExpireDate, new {@class = "grid-textbox-date"})
             @Html.ValidationMessageFor(model => model.ExpireDate)
         </div>
    
         <div class="gridcell">
             @Html.TextBoxFor(model => model.FreeQuantity, new {@class = "grid-textbox-num"})
             @Html.ValidationMessageFor(model => model.FreeQuantity)
         </div>
    
         <div class="gridcell">
             @Html.TextBoxFor(model => model.CostInput, new {@class = "grid-textbox-num"})
             @Html.ValidationMessageFor(model => model.CostInput)
         </div>
    
         <div class="gridcell">
             @Html.TextBoxFor(model => model.TotalCost, new {@class = "grid-textbox-num"})
             @Html.ValidationMessageFor(model => model.TotalCost)
         </div>
    
         <div class="gridcell action">
             <input type="submit" value="Update" name="btnSubmit"/>
             <input type="submit" value="Cancel" name="btnSubmit" />
         </div>

 }
    
<script type="text/javascript">
    $(function () {
        $.validator.unobtrusive.parse("#ajaxupdateform-@Model.ID");
    });
</script>